<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>企业审核详情</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/listDetail.css" media="all"/>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" href="../../css/news.css" media="all"/>
</head>
<body class="childrenBody">
<div class="contain">

    <h3><i class="layui-icon">&#xe63c;</i>企业审核信息</h3>
        <div class="layui-row">
          
            <div class="rightMain layui-col-md5 layui-col-sm5 layui-col-xs6">
                <div class="pic">
                    <img src="" id="pro_license" class="img-responsive" title="证书" alt="证书">
                </div>
            </div>
              <div class="leftMain layui-col-md7 layui-col-sm7 layui-col-xs6"> 
                <div class="contain-main">
                    <ul class="baseInfor layui-clear">
                        <li id='comp_name'><strong>企业名称：</strong></li>
                        <li id='comp_code'><strong>企业代码：</strong></li>
                        <li id='pro_phone'><strong>联系方式：</strong></li>
                        <li id='pro_email'><strong>电子邮箱：</strong></li>
                        <li id='pro_address'><strong>企业地址：</strong></li>
                    </ul>
                </div>
                <div class="industory">
                    <div class="one">
                        <strong>经营范围：</strong>
                        <p id='pro_scope'></p>
                    </div>
                    <div class="one">
                        <strong>企业介绍：</strong>
                        <p id='pro_intro'></p>
                    </div>
                    <div class="certificate">
                        <strong>其他材料：</strong>
                        <ul class="layui-clear layui-row" id="pro_honor">
                        </ul>
                    </div>
                </div>
            </div>
             <div class="btn layui-clear">
                        <input type="button" id="btns" value="审核通过">
                    </div>
        </div>
    </div>
<div id="alertWindow">
    <div class="img">
        <i class="layui-icon">&#x1006;</i>   
        <img src="">
    </div>
</div>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script>
//引入配置模块
layui.config({
	base:'js/'
}).use(['layer','jquery'],function(){
	layer = parent.layer === undefined ? layui.layer : parent.layer,
	$ = layui.jquery;
    //获取URL的参数
    function getPara(){
    	var url = location.search; //获取url中含"?"符后的字串
    	var theRequest = new Object();
    	if(url.indexOf("?") != -1){
			var str = url.substr(1);
    	    strs = str.split("&");
			for(var i = 0; i < strs.length; i ++) {
    	    	theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
    	      }
    	   }
		return theRequest;
    }
    //获取详细信息
    $.get('admincompany_findById',getPara(),function(data){
    	$('#comp_name').append(data[0].comp_name);
    	$('#comp_code').append(data[0].comp_code);
    	$('#pro_phone').append(data[0].profile.pro_phone);
    	$('#pro_email').append(data[0].profile.pro_email);
    	$('#pro_address').append(data[0].profile.pro_address);
    	$('#pro_scope').append(data[0].profile.pro_scope);
    	$('#pro_intro').append(data[0].profile.pro_intro);
    	$('#pro_license').attr('src','/xjeca/upload/companyinfo/'+data[0].profile.pro_license);
		if(data[0].profile.pro_requisition!=undefined){
    	$('#pro_honor').append('<li  class="layui-col-md3 layui-col-sm3 layui-col-xs3"><img onclick="bigImg(this)" title="入会申请" src="/xjeca/upload/companyinfo/'+data[0].profile.pro_requisition+'"></li>');
		}
		if(data[0].profile.pro_ratepaying!=undefined){
    	$('#pro_honor').append('<li  class="layui-col-md3 layui-col-sm3 layui-col-xs3"><img onclick="bigImg(this)" title="纳税证明" src="/xjeca/upload/companyinfo/'+data[0].profile.pro_ratepaying+'"></li>');			
		}
		if(data[0].profile.pro_aptitude!=undefined){
    	$('#pro_honor').append('<li  class="layui-col-md3 layui-col-sm3 layui-col-xs3"><img onclick="bigImg(this)" title="企业资质" src="/xjeca/upload/companyinfo/'+data[0].profile.pro_aptitude+'"></li>');			
		}
		if(data[0].profile.pro_NoCrime!=undefined){
    	$('#pro_honor').append('<li  class="layui-col-md3 layui-col-sm3 layui-col-xs3"><img onclick="bigImg(this)" title="无犯罪证明" src="/xjeca/upload/companyinfo/'+data[0].profile.pro_NoCrime+'"></li>');	
		}
		if(data[0].profile.pro_prove!=undefined){
    	$('#pro_honor').append('<li  class="layui-col-md3 layui-col-sm3 layui-col-xs3"><img onclick="bigImg(this)" title="其他证明"  src="/xjeca/upload/companyinfo/'+data[0].profile.pro_prove+'"></li>');			
		}
    	var honor=data[0].profile.pro_honor.split(', ');
    		for(var i=0;i<honor.length;i++){
		    	$('#pro_honor').append('<li class="layui-col-md3 layui-col-sm3 layui-col-xs3"><img onclick="bigImg(this)" title="荣誉证书" src="/xjeca/upload/companyinfo/'+honor[i]+'"></li>');
    	}
    },'json');
    $(" #alertWindow i").click(function () {
            $("#alertWindow").hide();
        });
	$('#btns').click(function(data){
 		$.get('admincompany_regApprove',getPara(),function(data,status){
			if(data==1){
				var result=top.layer.msg('审核成功',{time:1000})
				layer.closeAll("iframe");
			}
			if(data==0){
				var result=top.layer.msg('服务器错误',{time:1000})
				layer.closeAll("iframe");
			}
			
		});
	});
});

function popup(popupName) {
    var _scrollHeight = $(document).scrollTop(),//获取当前窗口距离页面顶部高度
        _windowHeight = $(window).height(),//获取当前窗口高度
        _windowWidth = $(window).width(),//获取当前窗口宽度
        _popupHeight = popupName.height(),//获取弹出层高度
        _popupWeight = popupName.width();//获取弹出层宽度
    _posiTop = (_windowHeight - _popupHeight) / 2 + _scrollHeight;
    _posiLeft = (_windowWidth - _popupWeight) / 2;
    popupName.css({"left": _posiLeft + "px", "top": _posiTop + "px", "display": "block"});//设置position
}
function bigImg(event) {
      var a =$(this).attr('src');
      $(" #alertWindow img").attr("src",event.src);
      popup($("#alertWindow"));
    }
    $(" #alertWindow i").click(function () {
        $("#alertWindow").hide();
    });
</script>
</body>
</html>